﻿<phone:PhoneApplicationPage
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
	xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
	xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
	mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800" 
	x:Class="PhoneGarage.MainPage"
	d:DataContext="{d:DesignData SampleData/MainViewModelSampleData.xaml}"
	SupportedOrientations="PortraitOrLandscape" Orientation="Portrait">
	<phone:PhoneApplicationPage.Resources>
		<DataTemplate x:Key="ItemTemplate">
			<StackPanel>
				<Image Source="{Binding image}" HorizontalAlignment="Left" Height="64" Width="64"/>
			</StackPanel>
		</DataTemplate>
		<ItemsPanelTemplate x:Key="ItemsPanelTemplate1">
			<toolkit:WrapPanel/>
		</ItemsPanelTemplate>
		<DataTemplate x:Key="SearchResultTemplate">
			<StackPanel>
				<TextBlock x:Name="txtTitle" Text="{Binding Title}" FontFamily="/PhoneGarage;component/Fonts/Fonts.zip#Impact" FontSize="32" Margin="0,0,0,3"/>
				<TextBlock x:Name="txtDescription" Text="{Binding Description}"/>
				<TextBlock x:Name="txtURL" Text="{Binding URL}" Margin="0,3,0,30" FontSize="21.333" MouseLeftButtonUp="txtURL_MouseLeftButtonUp">
					<TextBlock.Foreground>
						<SolidColorBrush Color="{StaticResource PhoneAccentColor}"/>
					</TextBlock.Foreground>
				</TextBlock>
			</StackPanel>
		</DataTemplate>
	</phone:PhoneApplicationPage.Resources>
	<phone:PhoneApplicationPage.ApplicationBar>
		<shell:ApplicationBar>
			<shell:ApplicationBar.MenuItems>
				<shell:ApplicationBarMenuItem x:Name="itemAbout" Text="about" Click="btnAbout_Click"/>
			</shell:ApplicationBar.MenuItems>
			<shell:ApplicationBarIconButton x:Name="btnAbout" IconUri="/icons/appbar.questionmark.rest.png" Text="about" Click="btnAbout_Click"/>
		</shell:ApplicationBar>
	</phone:PhoneApplicationPage.ApplicationBar>

	<phone:PhoneApplicationPage.FontFamily>
		<StaticResource ResourceKey="PhoneFontFamilyNormal"/>
	</phone:PhoneApplicationPage.FontFamily>
	<phone:PhoneApplicationPage.FontSize>
		<StaticResource ResourceKey="PhoneFontSizeNormal"/>
	</phone:PhoneApplicationPage.FontSize>
	<phone:PhoneApplicationPage.Foreground>
		<StaticResource ResourceKey="PhoneForegroundBrush"/>
	</phone:PhoneApplicationPage.Foreground>

	<!--LayoutRoot is the root grid where all page content is placed-->
	<Grid x:Name="LayoutRoot" Background="Transparent" DataContext="{Binding Source={StaticResource imagesDataSource}}">
		<!--Pivot Control-->
		<controls:Pivot x:Name="searchPivot" Title="WP7FATC">
			<controls:PivotItem x:Name="pivotSearch" Header="search">
				<Grid x:Name="gridSearch">
					<TextBox x:Name="txtSearch" Height="97" Margin="8,8,132,0" TextWrapping="Wrap" VerticalAlignment="Top"/>
					<Button x:Name="btnSearch" Content="Find" HorizontalAlignment="Right" Height="97" Margin="0,8,0,0" VerticalAlignment="Top" Width="128" Click="SubmitSearch"/>
					<toolkit:PerformanceProgressBar x:Name="progressBing" Height="100" Margin="8,161,8,0" VerticalAlignment="Top"/>
				</Grid>
			</controls:PivotItem>
			<controls:PivotItem x:Name="pivotWeb" Header="web">
				<ListBox x:Name="webSearchResult" ItemTemplate="{StaticResource SearchResultTemplate}" ItemsSource="{Binding}" d:DataContext="{d:DesignData /SampleData/SearchResultListSampleData.xaml}" Margin="0,0,8,8"/>
			</controls:PivotItem>
			<controls:PivotItem x:Name="pivotImages" Header="images">
				<ListBox x:Name="imagesSearchResult" ItemTemplate="{StaticResource ItemTemplate}" Margin="0,0,8,8" ItemsPanel="{StaticResource ItemsPanelTemplate1}"/>
			</controls:PivotItem>
		</controls:Pivot>
	</Grid>
</phone:PhoneApplicationPage>
